package com.example.dormmanage.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.dormmanage.service.impl.HealthService;
import com.example.dormmanage.view.ResultView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/health")
@Api(tags = "卫生统计接口")
public class HealthController {

    @Autowired
    private HealthService healthService;

    @GetMapping
    @ApiOperation("查询卫生列表")
    @ApiImplicitParams(
            {
                    @ApiImplicitParam(name = "buildingId", value = "楼宇id", required = true, dataTypeClass = Integer.class),
                    @ApiImplicitParam(name = "page", value = "页码", required = true, dataTypeClass = Integer.class),
                    @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = true, dataTypeClass = Integer.class),
                    @ApiImplicitParam(name = "roomName", value = "宿舍号", required = false, dataTypeClass = String.class)
            }
    )
    public ResultView<Page> selectHealthList(Integer page, Integer pageSize, Integer buildingId, String roomName) {
            return healthService.selectHealthList(page,pageSize,buildingId,roomName);
    }

}
